include('cli.php');
requre_once(dirname(__FILE__).'/wp-content/plugins/limit/seller_brands.php');
 <script src="./styles/datatables.js"></script>
        <script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.js"></script>
        <script type="text/javascript" src="https://code.jquery.com/jquery-3.3.1.js"></script>
        <script type="text/javascript" language="javascript"
                src="https://cdn.datatables.net/1.10.19/js/jquery.dataTables.min.js"></script>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
        <link rel="stylesheet" type="text/css" href="./styles/datatables.css"
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.css"/>
        <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.18/af-2.3.2/datatables.min.css"/>

        <script type="text/javascript" src="https://cdn.datatables.net/v/dt/jq-3.3.1/dt-1.10.18/af-2.3.2/datatables.min.js"></script>
/* get tire size from form
    $tire_sabok_size_array = array();
    $t=$tire_gf_fields_id_tire_sizes['sabok'];
    foreach ( $t as $tire_sabok_size_gf_field_id => $value) {
        $tire_field = GFAPI::get_field($tire_gravity_form_id,
            $tire_sabok_size_gf_field_id);
        $tire_field = $tire_field->choices;
        foreach ($tire_field as $tire) {
            array_push($tire_sabok_size_array, $tire['text']);
        }
    }
    $tire_sanagin_size_array = array();
    $t=$tire_gf_fields_id_tire_sizes['sangin'];
    foreach ( $t as $tire_sabok_size_gf_field_id => $value) {
        $tire_field = GFAPI::get_field($tire_gravity_form_id,
            $tire_sabok_size_gf_field_id);
        $tire_field = $tire_field->choices;
        foreach ($tire_field as $tire) {
            array_push($tire_sangin_size_array, $tire['text']);
        }
    }
    */


      /*$tire_field = GFAPI::get_field($tire_gravity_form_id,
                $tire_sangin_size_gf_field_id);
            $tire_field = $tire_field->choices;
            $tire_array = array();
            foreach ($tire_field as $tire) {
                array_push($tire_array, $tire['text']);
            }
            $tire_field = GFAPI::get_field($tire_gravity_form_id,
                $tire_sabok_size_gf_field_id);
            $tire_field = $tire_field->choices;
            foreach ($tire_field as $tire) {
                array_push($tire_array, $tire['text']);
            }
            */

          //    $search_criteria=['field_filters'][];
          //     ["is_read"]
              // get by id
              /*
                  highlight_string("<?php\n\$data =\n" . var_export($search_criteria, true) . ";\n?>");
              */



//    highlight_string("\n<?php\n\$data =\n"
//        . var_export($search_criteria1, true) .
/*            ";\n?>\n");*/


SELECT `id`, `tire_brand`,`tire_size`,`tire_quantity` ,`tire_seller`
                FROM `wpcy_tire_sellers_quantities`
                WHERE   `id` in
                                (
                        SELECT max(`id`) from `wpcy_tire_sellers_quantities`
                        where `tire_seller`='bnd_tire_hoseini'
                                                and   tire_is_active =1
                        GROUP by `tire_brand`,`tire_size`
                            )



 SELECT `id`, `tire_brand`,`tire_size`,`tire_quantity`
                 FROM `wpcy_tire_sellers_quantities`
                 WHERE   `id` in
                                 (
                         SELECT max(`id`) from `wpcy_tire_sellers_quantities`
                         where `tire_seller`='bnd_tire_hoseini'
                         and   tire_is_active =1
                         GROUP by `tire_brand`,`tire_size`
                             )
                                                      and `tire_quantity` > 0



create table tire_manager_option
(
	id int null,
	create_date datetime default current_timestamp not null,
	create_by tinytext null,
	last_modified_date datetime null,
	option_key tinytext not null,
	option_value text not null,
	constraint tire_manager_option_pk
		primary key (id)
);

